<template>
	<view v-if="props.list.length > 0" class="toBeDealt gy-custom-card">
		<view class="toBeDealt-head">
			<view class="toBeDealt-title">待办事项</view>
			<view class="toBeDealt-num">{{ props.list.length }}</view>
		</view>
		<view class="toBeDealt-mes">您有一条待支付{{ findType(props.list[0]) }}，请及时处理！</view>
		<!-- <view class="toBeDealt-content">
			<view class="toBeDealt-content-title">{{ findType(props.list[0]) }}通知</view>
			<view v-if="props.list[0].orderObj && props.list[0].orderObj.creator" class="toBeDealt-doctor">
				<com-avatar :src="props.list[0].orderObj.creator.doctorAvatar" :size="40" :radius="50" />
				<view class="toBeDealt-doctor-name">{{ props.list[0].orderObj.creator.doctorName }}</view>
				<view class="toBeDealt-doctor-post">{{ props.list[0].orderObj.creator.positionName }}</view>
			</view>
			<view class="toBeDealt-detai" @click.stop="toMoreFn">点击查看</view>
		</view> -->
	</view>
</template>

<script lang="ts" setup>
	import {
		ref,
		getCurrentInstance
	} from 'vue';

	const { proxy } : any = getCurrentInstance();

	const props = defineProps({
		list: {
			type: Array,
			default: () => []
		}
	});

	function findType(item : any) {
		if(item.type === 1){
			return "问诊";
		}else if(item.type === 2){
			return "处方";
		}else if(item.type === 3 || item.type === 4){
			return "检查检验";
		}else if(item.type === 5){
			return "病案邮寄";
		}else if(item.type === 6){
			return "会诊";
		}else if(item.type === 7){
			return "商城";
		}else{
			return "护理";
		}
	}

	function toMoreFn() {
		proxy.utils.uni.route.go("/pages-hospital-services/wait-processing/index");
	}
</script>

<script lang="ts">
	export default {
		options: {
			multipleSlots: true,
			styleIsolation: 'shared',
			addGlobalClass: true,
			virtualHost: true
		}
	}
</script>

<style lang="scss" scoped>
	.toBeDealt {
		background: url('https://guoyi.oss-cn-beijing.aliyuncs.com/3caa2fa1e4eeda09cb43a9eb3ce072af36a48b2a420016c7bb07b90b6b21b823.png');
		background-size: 100% 100%;
		padding-top: 65rpx;

		.toBeDealt-head {
			@include flex-start-center;

			.toBeDealt-title {
				height: 44rpx;
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 32rpx;
				color: #2E344A;
			}

			.toBeDealt-num {
				width: 40rpx;
				height: 40rpx;
				@include flex-center-center;
				font-size: 24rpx;
				color: #FFFFFF;
				background: linear-gradient(129deg, #FF8772 0%, #F64E32 100%);
				border-radius: 10rpx 10rpx 10rpx 0rpx;
				border: 4rpx solid #FFFFFF;
				text-align: center;
				margin-left: 20rpx;
			}
		}

		.toBeDealt-mes {
			margin-top: 15rpx;
			height: 40rpx;
			font-family: PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #2E344A;
			line-height: 40rpx;
			margin-bottom: 24rpx;
		}

		.toBeDealt-content {
			@include flex-between-center;
			.toBeDealt-content-title {
				font-size: 28rpx;
				font-weight: bold;
			}

			.toBeDealt-doctor {
				flex: 1;
				@include flex-start-center;
				margin-left: 20rpx;

				:deep(.gy-avatar){
					display: block;
				}

				.toBeDealt-doctor-name {
					margin-left: 10rpx;
					font-size: 28rpx;
					color: var(--gy-text-color-regular);
				}

				.toBeDealt-doctor-post {
					margin-left: 10rpx;
					font-size: 24rpx;
					color: var(--gy-text-color-secondary);
				}
			}

			.toBeDealt-detai {
				width: 180rpx;
				height: 70rpx;
				@include flex-center-center;
				background: rgba(87, 149, 255);
				border-radius: 35rpx;
				font-size: 28rpx;
				color: #fff;
				margin-left: 52rpx;
			}

		}
	}
</style>
